package com.youhome.result;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by chen365 on 2018/05/10.
 */
@Data
@ApiModel
@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
public class AssociateAddress {
    @ApiModelProperty(notes = "房源ID")
    private String houseId;

    @ApiModelProperty(notes = "地址")
    private String address;

    @ApiModelProperty(notes = "价格")
    private Double listPrice;

    @ApiModelProperty(notes = "卧室数量")
    private Integer bedroomCount;

    @ApiModelProperty(notes = "浴室数量")
    private Integer bathroomCount;

    @ApiModelProperty(notes = "面积")
    private Double livingArea;

    @ApiModelProperty(notes = "图片")
    private String photo;

    public String getPhoto() {
        if (!StringUtils.isEmpty(photo)) {
            photo = "https://youhome.oss-cn-zhangjiakou.aliyuncs.com/" + photo;
        }
        return photo;
    }
}
